import { ref, watchEffect } from "vue";
import * as todoStorage from "../util/todoStorage";
export default function useTodoList() {
  // 设置初始值为数组
  const todoRef = ref(todoStorage.fetch());
  watchEffect(() => {
    todoStorage.save(todoRef.value);
  });
  return todoRef;
}


